package com.hfh.homework;

import org.junit.Test;

import java.io.*;
import java.util.ArrayList;
import java.util.List;

/**
 * @Author hfh
 * @Date 2022 09 07 14 20
 **/
public class Work4 {
    @Test
    public void test(){
        List<String> list = new ArrayList<>();
        try(BufferedReader br = new BufferedReader(new FileReader("file/a.txt"))) {
            String str;
            while ((str=br.readLine())!=null){
                list.add(str);
            }
        }catch (IOException e) {
            e.printStackTrace();
        }
        for (String s:list){
            System.out.println(s);
        }

    }
}
